<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{commons/common::head(~{::title})}">
    <meta charset="UTF-8">
    <title>Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
</head>
<body class="login-bg">

<br>
<br>

<div class="m-container-small m-padded-tb-massive" style="max-width: 30em !important;">
    <div class="ui container">

        <div class="ui middle aligned center aligned stackable grid">
            <div class="column">
                <h2 class="ui teal image header">
                    <img src="https://picsum.photos/id/1/800/450" class="image">
                    <div class="content">
                        后台管理登录
                    </div>
                </h2>

                <!--form 表单-->
                <form class="ui large form" method="post" th:action="@{/login}">
                    <div class="ui segment">
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="user icon"></i>
                                <input type="text" name="username" placeholder="用户名">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="lock icon"></i>
                                <input type="password" name="password" placeholder="密码">
                            </div>
                        </div>
                        <div class="field" style="text-align: left !important;">
                            <div class="ui checkbox">
                                <input type="checkbox" name="rememberMe" tabindex="0" class="hidden" id="checkbox">
                                <label for="checkbox">记住我</label>
                            </div>
                        </div>

                        <input type="submit" class="ui fluid large teal button" value="登录"/>
                    </div>

                    <div class="ui error message"></div>
                    <div class="ui negative message" th:if="${!#strings.isEmpty(msg)}" th:text="${msg}"></div>

                </form>


            </div>
        </div>
    </div>
</div>


<!--引用的 js-->
<th:block th:replace="~{commons/admin_com::script}">
</th:block>

<script>
    // 提交博客表单校验
    $('.ui.form').form({
        fields: {
            username: {
                identifier: 'username',
                rules: [{
                    type: 'empty',
                    prompt: '用户名不能为空'
                }]
            },
            password: {
                identifier: 'password',
                rules: [{
                    type: 'empty',
                    prompt: '密码不能为空'
                }]
            }
        }
    });
</script>

</body>
</html>